
package personas.controller;

import personas.model.Persona;
import controller.*;
import java.sql.ResultSet;
import java.util.Vector;



public class PersonaMgr extends DbManager {

    public static final PersonaMgr mgr = new PersonaMgr();
    
private PersonaMgr() {
        super( "Persona" );
        m_titles = new String[]{"NOMBRES", "DIRECCIÓN", "TELÉFONO", "E-MAIL" };
    }

   @Override
    protected Persona getBean() {
        return new Persona();
    }

    @Override
    @SuppressWarnings("unchecked")
    protected void addObject( Vector v, ResultSet rs ) {
        v.add( new Persona( rs ) );
    }

    @Override
    public synchronized Persona getItem( String id ) {
        return (Persona)super.getItem(id);
    }

    public synchronized Vector<Persona> getList() {
        return executeQuery( "select * from Persona" );
    }

    public synchronized Vector<Persona> getResult() {
        return executeQuery( "Select max(id) from Persona" );

    }

}
